package com.ywy.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ywy.dao.ClothMapper;
import com.ywy.dao.ColorAndSizeMapper;
import com.ywy.entity.Cloth;
import com.ywy.entity.ColorAndSize;
import com.ywy.service.ClothService;

@Service
public class ClothServiceImpl implements ClothService{
	@Autowired
	private ClothMapper cm;
	@Autowired
	private ColorAndSizeMapper casm;

	@Override
	@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
	public boolean addcloth(Cloth cloth, ColorAndSize cas) {
		// TODO Auto-generated method stub
		cm.addClothInfo(cloth);
	    casm.addColorAndSizeInfo(cas);
			return true;
		}
		
		
	

}
